<style type="text/css">
    .vote_ul li{
        height: 37px;
        margin-bottom : 3px;
    }
    .vote_ul li input {
        float: left;
        width: 60%;
    }
    .vote_ul li .operate {
        margin-left: 6px;
        display: block;
        float: left;
        cursor: pointer;
        width: 30%;
    }
    .vote_ul li a{
        font-size:19px;
    }
    .form-box {
        border: 1px solid #ccc;
        padding: 15px 15px 0px 15px;
        margin-bottom: 15px;
        width: 662px;
        float: left;
    }
    .form-box .col-sm-5 {
        width: 530px
    }
    .form-box .col-sm-5 input{
      width: 450px;
    }
    .form-box .form-group label{
        width: 100px;
        margin-left: 17px;
    }
    .form-box  .vote_ul li .operate {
        width: 40px;
    }
    .form-box  .col-sm-4 {
      width: 476px;
    }
     .form-box-left .form-box-t {
        padding-right: 29px;
    }
</style>
<form action="" class="form-horizontal" role="form">
    <div class="form-group">
		    <label class="col-sm-2 control-label">排序</label>
		    <div class="col-sm-2">
		    	<input type="number" class="form-control" name="sort" min="0" value="{$microVoteItem.sort}" />
		    </div>
	</div>
    <div class="form-group ">
        <label class="col-sm-2 control-label">选项标题</label>
        <div class="col-sm-5">
            <input type="text" id="title" class="form-control" name="title" placeholder="" datatype="*" value="{$microVoteItem.title}"/>
        </div>
    </div>
 <div class="form-group">
	    <label class="col-sm-2 control-label">选项图片</label>
	    <div class="col-sm-4">
	    	<div class="image-result-content">
	    		<img id="logo-result" class="margin-bottom" />
	    	</div>
	    	<input type="text" id="pic" name="pic" class="form-control margin-bottom" value="{$microVoteItem.pic}" />
			<input type="file" name="pic_upload" id="pic_upload" />
	    </div>
	</div>
  	<div class="form-group">
	    <label class="col-sm-2 control-label">描述</label>
	    <div class="col-sm-5">
	      <textarea rows="3" cols="20" class="form-control" name="desc" >{$microVoteItem.desc}</textarea>
	    </div>
	</div>


    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-8">
            <a class="btn btn-default" onclick="javascript:history.go(-1)">返回上页</a>
            <a class="btn btn-default" onclick="self.location=document.referrer">返回上页并刷新</a>
            <input type="hidden" name="micro_vote_id" value="{$microVoteItem.micro_vote_id}"/>
             <input type="hidden" name="id" value="{$microVoteItem.id}"/>
            <button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/save">保存更改</button>
        </div>
    </div>
</form>

<!-- uploadify -->
<link rel="stylesheet" href="__PUBLIC__/Style/Common/uploadify/uploadify.css">
<script type="text/javascript" src="__PUBLIC__/Style/Common/uploadify/jquery.uploadify.min.js?{:rand(0,9999)}"></script>
<script type="text/javascript">
$(function() {
    $("#pic_upload").uploadify({
        'multi'			:	false,
        'fileSizeLimit' : 	'200kb',
        'buttonText'	:	'选择图片',
        'fileTypeDesc' 	: 	'Image Files',
        'fileTypeExts' 	: 	'*.jpg; *.png',
        'swf'			: 	'__PUBLIC__/Style/Common/uploadify/uploadify.swf',
        'uploader'		: 	'__MODULE__/Upload/uploadOne',
        'onUploadSuccess'	: function(data, res){
        	
        	var url = eval("(" + res + ")").extra.url;
        	$("#logo-result").attr("src", url);
        	$("#pic").val( url );
        	
        }
    });
  
});
</script>